// 导入vue-router包
import VueRouter from 'vue-router';

//导入对应的路由组件
import homeContainer from "../components/tabbar/homeContainer.vue";
import memberContainer from "../components/tabbar/memberContainer.vue";
import shopCarContainer from "../components/tabbar/shopCarContainer.vue";
import searchContainer from "../components/tabbar/searchContainer.vue";
import newsList from "../components/tabbar/news/newsList.vue";
import newsInfo from "../components/tabbar/news/newsInfo.vue";
import PhotoList from "../components/tabbar/photos/PhotoList.vue";
import photoInfo from "../components/tabbar/photos/PhotoInfo.vue"
import goodsList from "../components/tabbar/goots/goodsList.vue";
import goodsInfo from "../components/tabbar/goots/goodsInfo.vue";
import GoodsDesc from "../components/tabbar/goots/GoodsDesc.vue";
import GoodsComment from "../components/tabbar/goots/GoodsComment.vue";


var router = new VueRouter({//创建路由对象
    routes : [//配置路由规则
        {path : '/', redirect(){return '/home'}},
        {path : '/home', component : homeContainer},
        {path : '/member', component : memberContainer},
        {path : '/shop', component : shopCarContainer},
        {path : '/search', component : searchContainer},
        {path : '/home/newslist', component : newsList},
        {path : '/home/newsinfo/:id', component : newsInfo},
        {path : '/home/photolist', component : PhotoList},
        {path : '/home/photoInfo/:id', component : photoInfo},
        {path : '/home/goodslist', component : goodsList},
        {path : '/home/goodsinfo/:id', component : goodsInfo, name : 'goodsinfo'},
        {path : '/home/goodsdesc/:id', component : GoodsDesc, name : 'goodsdesc'},
        {path : '/home/goodscomment/:id', component : GoodsComment, name : 'goodscomment'},
    ],
    linkActiveClass : 'mui-active', // 覆盖默认的默认的路由高亮的类，默认的类叫做 router-link-active
});
export default router ;// 把路由对象暴露出去